-
Notifications
You must be signed in to change notification settings - Fork 160
Hol err datatype #1656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hol err datatype #1656
Conversation
|
Ouch. Selftests are failing because of a change to the batch-mode error reporting. Will be a few days before I clean this up. But a |
|
This is now ready. There weren't many problems with the selftests. I haven't looked at MoscowML. But, as I wrote above, at least two things need to be improved once this change is (I hope) accepted.
The mode distinction and its treatment is straightforward (Michael's code): Basically ... Having looked at it a bit more, I wonder whether the invocation of |
- modify HOL_ERR representation to use a stack of origins - more pursuit of nice error messages coming from Modern Syntax
|
Per @ordinarymath 's original idea, |
|
I'll investigate into the impact on CakeML later this week |
|
OK, have now built on MoscowML. There were a few files that seem to get built for mosml but not PolyML (some in HolQbf and patriciaLib.sml). I also seem to have found the answer to the highly vexing question "why doesn't the REPL invoke the installed prettyprinter for |
…properly on HOL_ERR argument
|
Time to move this over to |
in the REPL, gives the following: while just invoking the parser on the badly typed formula in the REPL actually shows the problem The problem seems to be in |
|
Setting this back to being a draft PR until the |
|
The |
Improvements to
HOL_ERR. Currently HOL error messages get unnecessarily repeated as various layers of handling unwind, both in the REPL and in batch mode. This PR changes the representing type forHOL_ERRto be a 1-constructor datatype wrapping the current record type, then adds a prettyprinter for the datatype. This lets the REPL printHOL_ERRs that propagate to the top level only once. For batch processing, the originalHOL_ERRcan be printed and then further error messages are minimized.There is still some fine-tuning to be done on the look-and-feel of messages, in particular for "user-facing" tools. For example, type inference failures are annoyingly repeated, as are other parse failures. I also haven't looked at whether the inductive type definition failures need cleaning up.
Not sure how this will impact CakeML. Hopefully not much